const express = require('express');
const router = express.Router();
const DifyController = require('../controllers/dify.controller');
const authMiddleware = require('../middlewares/auth.middleware');

// 所有路由都需要认证
router.use(authMiddleware);

// 创建新会话
router.post('/sessions', DifyController.createSession);

// 发送消息
router.post('/messages', DifyController.sendMessage);

// 获取会话历史消息
router.get('/sessions/:sessionId/messages', DifyController.getMessages);

module.exports = router; 